package restless.core {
	
	import restless.core.gameObjs.RLEBackground;
	import restless.core.interfaces.I2d;
	import restless.core.interfaces.IAchieve;
	import restless.core.interfaces.IGrid;
	import restless.core.interfaces.ILevel;
	import restless.core.gameObjs.RLEGameObj;
	import restless.core.interfaces.ICheckColisions;
	
	/**
	 * @author Jordan Laine
	 */
	
	public class RLELevel extends RLEGameObj implements IAchieve, ILevel {
		protected var _player:RLEGameObj;
		protected var nPowerups:int;
		protected var vPowerupClasses:Vector.<Class> = new <Class>[];
		protected var levelBKG:RLEBackground;
		
		protected var _map:*;
		protected var _gridSpace:int;
		protected var _diagonal:Boolean;
		private var _tile:*;
		
		private var powerupOnScreenTimes:Array = [];
		private var powerupActiveTimes:Array = [];
		
		protected var vLevelStats:Vector.<RLEStat> = new Vector.<RLEStat>;
		protected var vLevelStatIDs:Vector.<String> = new Vector.<String>;
		
		protected var cameraStartX:int = 0;
		protected var cameraStartY:int = 0;
		
		// Power up vars
		protected var vPowerupIDs:Vector.<String>;
		protected var tempCamera:RLECamera;
		
		//Game init
		public function RLELevel() {
			setRE();
		}
		
		public function build():void {
			
		}
		
		public function set player(player:RLEGameObj):void {
			_player = player;
		}
		
		public function get player():RLEGameObj {
			return _player;
		}
		
		public function achievmentComplete(id:int):void {
			
		}
		
		protected function initPowerups(num:int):void {
			nPowerups = num;
			powerM.init(nPowerups, powerupOnScreenTimes, powerupActiveTimes, vPowerupClasses);
			vPowerupBool = powerM.getBools();
			vPowerupIDs = powerM.getStrings();
		}
		
		public function rebuild():void { 
			
		}
		
		public function get map():* {
			return _map;
		}
		
		public function set map(m:*):void {
			map = m;
		}
		
		protected function generateMap(tile:*, w:int, h:int, space:int):void {
			_tile = tile;
			if (space) { _gridSpace = space; }
		}
		
		public function get gridSpace():int {
			return _grid;
		}
		
		public function get diagonalMove:Boolean {
			return _diaganal;
		}
		
		override public function dispose():void {
			vPowerupClasses = null;
			powerupOnScreenTimes = null;
			powerupActiveTimes = null;
			vPowerupIDs = null;
			_player = null;
			levelBKG.dispose();
			levelBKG = null;
			tempCamera = null;
		}
		
	}

}